﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sky.Connect.Util;

namespace CMS.WebSite.liuhongbing.connect
{
    public partial class Oauth : System.Web.UI.Page
    {
        //b  1:新浪  2:腾讯
        protected void Page_Load(object sender, EventArgs e)
        {
            String type = Request.QueryString["type"];
            byte b = 0;
            if (Byte.TryParse(type, out b))
            {
                if (b == 0) b = 1;
            }
            if (b > 2) b = 1;
            Session["siteType"] = b;
            Site site = b == 1 ? Sky.Connect.Util.Site.Weibo : Sky.Connect.Util.Site.Tentent;
            String oauthUrl = Sky.Login.CreateConnect.CreateConnectFactory(site);
            Response.Redirect(oauthUrl);
        }
    }
}